import axios from 'axios';
//设置密码
const URI_PASSWORD = "/security/api/index/password";
//读取所有可设置启动项
const URI_LAUNCHERS = "/security/api/index/launchers";
//开启关闭启动项
const URI_LAUNCHER = "/security/api/index/launcher";

export const changePassword = (params, callback = function(res) {}) => {
	axios.post(URI_PASSWORD, params).then((response) => {
		callback(response.data);
	});
}

export const loadLaunchers = (callback = function(res) {}) => {
	axios.post(URI_LAUNCHERS).then((response) => {
		callback(response.data);
	});
}

export const changeLauncherEnable = (lid, enable, callback = function(res) {}) => {
	axios.post(URI_LAUNCHER, { lid, enable }).then((response) => {});
}

export default {
	changePassword,
	loadLaunchers,
	changeLauncherEnable
}